<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="/WEB-INF/jsp/include/head.jsp"/>
</head>
<body>

<ol class="breadcrumb">
    <li><strong>当前位置： </strong>评价管理</li>
    <li class="active">汇总查询</li>
</ol>


<div class="panel panel-info">
    <div class="panel-heading">
        <h3 style="display: inline-block" class="panel-title">查询</h3>
    </div>
    <div class="panel-body">
        <form id="form_search" class="form-horizontal row">
            <div class="form-group col-sm-5">
                <label class="control-label col-sm-4 ">评价类别：</label>
                <div class="col-sm-8">
                    <select id="assessType" class="form-control" name="assessType">
                        <option <c:if test="${assessType=='inspectorAssess'}">selected</c:if>  value="inspectorAssess">专家评价</option>
                        <option <c:if test="${assessType=='companyAssess'}">selected</c:if>   value="companyAssess">企业评价</option>
                        <option <c:if test="${assessType=='observerAssess'}">selected</c:if>   value="observerAssess">观察员评价</option>
                        <option <c:if test="${assessType=='managerAssess'}">selected</c:if>   value="managerAssess">经办人评价</option>
                        <option <c:if test="${assessType=='observerReport'}">selected</c:if>   value="observerReport">观察报告</option>
                    </select>
                </div>
            </div>

            <div class="form-group col-sm-5">
                <label class="col-sm-4  control-label">企业名称：</label>
                <div class="col-sm-8">
                    <input name="companyName" class="form-control" type="text">
                </div>
            </div>

            <div class="form-group col-sm-5">
                <label class="col-sm-4  control-label">产品名称：</label>
                <div class="col-sm-8">
                    <input name="productName" class="form-control" type="text">
                </div>
            </div>








            <div class="form-group col-sm-5">
                <label class="col-sm-4  control-label">核查日期：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <div class="input-group date form_date timeInput">
                       <span class="input-group-addon">
                          <span class="glyphicon glyphicon-calendar"></span>
                       </span>
                            <input class="form-control" type="text" name="startTime">
                        </div>
                        <span class="input-group-addon"
                              style="width: auto;padding-right: 3px;padding-left: 3px;border-width: 0px;background-color: transparent">
                          <span>~</span>
                       </span>
                        <div class="input-group date form_date timeInput">
                       <span class="input-group-addon">
                          <span class="glyphicon glyphicon-calendar"></span>
                       </span>
                            <input class="form-control" type="text" name="endTime">
                        </div>
                    </div>
                </div>
            </div>

            <div class="form-group col-sm-5">
                <label class="col-sm-4  control-label">评价专家：</label>
                <div class="col-sm-8">
                    <input name="fromPerson" class="form-control" type="text">
                </div>
            </div>

            <div class="form-group col-sm-5">
                <label class="col-sm-4  control-label">被评价专家：</label>
                <div class="col-sm-8">
                    <input name="toPerson" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group col-sm-2">
                <div class=" col-sm-offset-3">
                    <button id="btn_search" type="button" class="btn btn-default "><span
                            class="glyphicon glyphicon-search"></span>&nbsp;查&nbsp;询&nbsp;</button>
                </div>
            </div>
        </form>

    </div>
</div>

<table id="table_data"></table>

<div class="modal fade" id="modal_ajax">
    <div class="modal-dialog">
        <div class="modal-content">
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->


<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>


<script>

    var assessType = {0: '差', 1: '一般', 2: '好'}, $table_data = $('#table_data'), $btn_search = $('#btn_search');

    $table_data.bootstrapTable({
        url: 'business/assessPool/select',
        striped: true,
        cache: false,
        sidePagination: 'server',
        searchOnEnterKey: false,
        pageSize: 10,
        pageList: [10, 20, 50],
        pageNumber: 1,
        pagination: true,
        queryParams: function (params) {
            $.extend(params, $("#form_search").serializeObject());
            return params
        },
        columns: [
            [
                {
                    rowspan: 2,
                    valign: 'middle',
                    formatter: function (value, row, index) {
                        return [index + 1].join('');
                    }
                },
                {
                    field: 'fromInspectorInfo',
                    title: '评价专家',
                    rowspan: 2,
                    valign: 'middle',
                    formatter: function (value, row, index) {
                        return value&&value.expertName;
                    }
                },
                {
                    field: 'toInspectorInfo',
                    title: '被评价专家',
                    rowspan: 2,
                    valign: 'middle',
                    formatter: function (value, row, index) {
                        return value&&value.expertName;
                    }
                },
                {
                    field: 'businessInfo',
                    title: '企业名称',
                    rowspan: 2,
                    valign: 'middle',
                    formatter: function (value, row, index) {
                        return value&&value.companyName;
                    }
                },
                {
                    field: 'businessInfo',
                    title: '产品名称',
                    rowspan: 2,
                    valign: 'middle',
                    formatter: function (value, row, index) {
                        return value&&value.productName;
                    }
                },
                {
                    field: 'businessInfo',
                    title: '核查时间',
                    rowspan: 2,
                    valign: 'middle',
                    formatter: function (value, row, index) {
                        return $.Helper.dataTimeHelper.int2DateString(value&&value.endTime);
                    }
                },
                {
                    title: '评价内容',
                    colspan: 5
                }
            ],
            [

                {
                    field: 'cooperation',
                    title: '协调配合能力',
                    formatter: function (value, row, index) {
                        return $.sysPlugin.ifElse(value, assessType);
                    }
                },
                {
                    field: 'business',
                    title: '专家业务能力',
                    formatter: function (value, row, index) {
                        return $.sysPlugin.ifElse(value, assessType);
                    }
                }
                ,
                {
                    field: 'fairness',
                    title: '公平公正性',
                    formatter: function (value, row, index) {
                        return $.sysPlugin.ifElse(value, assessType);
                    }
                }
                ,
                {
                    field: 'honest',
                    title: '廉洁自律',
                    formatter: function (value, row, index) {
                        return $.sysPlugin.ifElse(value, assessType);
                    }
                }
                ,
                {
                    field: 'comprehensive',
                    title: '综合评价',
                    formatter: function (value, row, index) {
                        return $.sysPlugin.ifElse(value, assessType);
                    }
                }
            ]
        ]
    });

    $btn_search.click(function () {
        $table_data.bootstrapTable('refresh');
    });
    $("#assessType").change(function () {

        window.location.href="business/assessPool/index?assessType="+$(this).val();
        $(this).attr('disabled',true);
    });

    $.sysPlugin.initDateTimeInput();
    $.sysPlugin.initSimpleSelect2();


</script>


</body>
</html>